import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/views/Layout.vue'
import One from '@/views/RequirementOne.vue'
import Two from '@/views/RequirementTwo.vue'
import Three from '@/views/RequirementThree.vue'
import Four from '@/views/RequirementFour.vue'
import Five from '@/views/RequirementFive.vue'
import Six from '@/views/RequirementSix.vue'
import Seven from '@/views/RequirementSeven.vue'
import Eight from '@/views/RequirementEight.vue'
import Login from "@/views/Login.vue"
import Register from "@/views/Register.vue"
import Nine from '@/views/RequirementNine.vue'
import Ten from '@/views/RequirementTen.vue'
import Eleven from '@/views/RequirementEleven.vue'
import Twelve from '@/views/RequirementTwelve.vue'
// 创建路由实例，维护路径与组件的关系
// 路径抽取到外部，匹配的话才向内部嵌套路由
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [{
      path: '/', 
      component: Layout,
      redirect: '/login',
      children: [
        {path:'showone',component: One},
        {path:'showtwo',component:Two},
        {path:'showthree',component:Three},
        {path:'showfour',component:Four},
        {path:'showfive',component:Five},
        {path:'showsix',component:Six},
        {path:'showseven',component:Seven},
        {path:'showeight',component:Eight},
          {path:'shownine',component:Nine},
          {path:'showten',component:Ten},
          {path:'showeleven',component:Eleven},
          {path:'showtwelve',component:Twelve}
        ]},
      {path:'/login',component:Login},
      {path:'/register',component:Register}
      ]
})

export default router
